r = 1 gotwhiskey = 1 oldman = 1 SCREEN 12 COLOR 7, 0 CLS DIM SHARED DOOM AS DOUBLE Minutes = 10 Seconds = 0 GameTime = Minutes * 60 + Seconds DIM directions(1 TO 11) AS STRING directions(1) = "SOUTH" directions(2) = "NORTH OR EAST" directions(3) = "WEST, EAST, OR SOUTH" directions(4) = "WEST" directions(5) = "NORTH OR EAST" directions(6) = "WEST OR SOUTH" directions(7) = "NORTH OR EAST" directions(8) = "NORTH OR WEST" directions(9) = "EAST OR SOUTH" directions(10) = "EAST OR WEST" directions(11) = "EAST" PRINT "" PRINT "" PRINT "You find yourself standing in the entrance of the old Hotel. You can hear" PRINT "the cries of the beast, screaming, and scratching at the door. You are safe" PRINT "for the time being. Better find the source of that scream." PRINT "" DO: LOOP UNTIL INKEY$ <> "" DOOM = TIMER(0.001) + GameTime 'change this to to desied time for the game to run DO CLS PRINT PRINT PRINT " " PRINT " " PRINT " " PRINT " The Lurking Beast - Chapter 3 " PRINT " " PRINT " Written by " PRINT " " PRINT " D.B. Taylor" PRINT "" PRINT " Copyright (c) 2016" PRINT "" PRINT SPACE$(38); IF INSTR(directions(r), "NORTH") THEN PRINT "N" ELSE PRINT PRINT "*---------------------------------* "; IF INSTR(directions(r), "WEST") THEN PRINT "W"; ELSE PRINT " "; PRINT " + "; IF INSTR(directions(r), "EAST") THEN PRINT "E"; ELSE PRINT " "; PRINT " *------------------------------------*" PRINT SPACE$(38); IF INSTR(directions(r), "SOUTH") THEN PRINT "S" ELSE PRINT PRINT PRINT "If you are stuck just type HELP." PRINT GOSUB ROOM GOSUB parser LOOP ROOM: IF r = 1 THEN: GOSUB r1 IF r = 2 THEN: GOSUB r2 IF r = 3 THEN: GOSUB r3 IF r = 4 THEN: GOSUB r4 IF r = 5 THEN: GOSUB r5 IF r = 6 THEN: GOSUB r6 IF r = 7 THEN: GOSUB r7 IF r = 8 THEN: GOSUB r8 IF r = 9 THEN: GOSUB r9 IF r = 10 THEN: GOSUB r10 IF r = 11 THEN: GOSUB r11 RETURN parser: PRINT "> "; cmd$ = GrabInput cmd$ = LTRIM$(RTRIM$(UCASE$(cmd$))) IF cmd$ = "END" OR cmd$ = "QUIT" OR cmd$ = "EXIT" OR cmd$ = "Q" THEN END END IF IF cmd$ = "HELP" OR cmd$ = "H" OR cmd$ = "?" THEN CLS PRINT "HERE ARE SOME BASIC COMMANDS THAT CAN BE USED IN THE GAME..." PRINT PRINT "NORTH, EAST ,SOUTH, AND WEST - MOVE TO AN AVAILABLE LOCATION" PRINT "EXAMINE (OBJECT) - EXAMINE AN OBJECT" PRINT "USE (OBJECT) - USE AN OBJECT" PRINT "TAKE (OBJECT) - TAKE OR MOVE AN OBJECT" PRINT "INVENTORY - VIEW YOUR INVENTORY" PRINT "DRINK - DRINK BEER" PRINT "UNLOCK - UNLOCK DOOR" PRINT "HELP - VIEW THIS SCREEN" PRINT "END - END GAME" PRINT PRINT "PRESS ANY KEY...": SLEEP DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "INVENTORY" OR cmd$ = "INV" OR cmd$ = "ITEMS" OR cmd$ = "I" THEN CLS PRINT "INVENTORY..." PRINT IF gotwhiskey = 1 THEN: PRINT "A bottle of whiskey." PRINT PRINT "PRESS ANY KEY..." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF cmd$ = "GO NORTH" OR cmd$ = "NORTH" OR cmd$ = "N" THEN IF r = 2 THEN: r = 1: GOTO moved IF r = 5 THEN: r = 3: GOTO moved IF r = 7 THEN: r = 6: GOTO moved IF r = 8 THEN: r = 9: GOTO moved END IF IF cmd$ = "GO EAST" OR cmd$ = "EAST" OR cmd$ = "E" THEN IF r = 2 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 4: GOTO moved IF r = 5 THEN: r = 6: GOTO moved IF r = 7 THEN: r = 8: GOTO moved IF r = 9 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 11: GOTO moved END IF IF cmd$ = "GO SOUTH" OR cmd$ = "SOUTH" OR cmd$ = "S" THEN IF r = 1 THEN: r = 2: GOTO moved IF r = 3 THEN: r = 5: GOTO moved IF r = 6 THEN: r = 7: GOTO moved IF r = 9 THEN: r = 8: GOTO moved END IF IF cmd$ = "GO WEST" OR cmd$ = "WEST" OR cmd$ = "W" THEN IF r = 4 THEN: r = 3: GOTO moved IF r = 3 THEN: r = 2: GOTO moved IF r = 6 THEN: r = 5: GOTO moved IF r = 8 THEN: r = 7: GOTO moved IF r = 11 THEN: r = 10: GOTO moved IF r = 10 THEN: r = 9: GOTO moved END IF IF (cmd$ = "EXAMINE OLD MAN") AND r = 3 THEN CLS PRINT "He must be as old as this Hotel itself. He is weathered, tired in" PRINT "appearance, and looks as if he's a statue." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "TALK TO OLD MAN") AND r = 3 THEN CLS PRINT "Clearing his throat. He smiles and nods. Then with a tired voice" PRINT "speaks. -So you are here to replace the last fellow? No matter, it's" PRINT "not as if you'll figure it out. It feeds of fear and not the flesh." PRINT "Keep that in mind when you venture through room eleven.-" DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "EXAMINE WHISKEY") AND gotwhiskey = 1 THEN CLS PRINT "An old bottle of whiskey, from a forgotten era. Looks tasty." DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "DRINK WHISKEY") AND gotwhiskey = 1 THEN CLS GOTO lose DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF IF (cmd$ = "DRINK WHISKEY") AND gotwhiskey = 1 AND r = 11 THEN CLS GOTO win: DO: LOOP UNTIL INKEY$ = "" DO: LOOP UNTIL INKEY$ <> "" END IF moved: RETURN r1: PRINT "You are standing in the grand entrance to the old Hotel. The" PRINT "smell of dust and decay in the air." RETURN r2: PRINT "The faint music of a piano fills the air. Though you can't seem" PRINT "to see where it's coming from." RETURN r3: PRINT "The front desk to this once lively Hotel. You see an old man standing" PRINT "behind the front desk." RETURN r4: PRINT "A small corner, cut off from the Hotel, and completely empty." RETURN r5: PRINT "This Hotel seems to be like a grave. You wonder just how many others" PRINT "came here and never checked out?" RETURN r6: PRINT "You are standing in the errie hallway. You hear a woman crying..." PRINT "is she the same as before? Maybe it's mom?" RETURN r7: PRINT "The lights begin to flicker as you seem to be not alone." RETURN r8: PRINT "The sound of footsteps surround you. The smell of death lingers in" PRINT "the air." RETURN r9: PRINT "A voice tells you to pass through the door with what will weaken the" PRINT "senses. A world unlike this and not like the one back home." RETURN r10: PRINT "The sobs of the same woman crying is heard." RETURN r11: PRINT "Your each a dead end. But where are the rooms? Where is the source of" PRINT "the crying? Just what is going on here?" RETURN win: COLOR 7, 0 CLS PRINT "You break the seal on the bottle of whiskey and begin drinking like" PRINT "a mad man. Moments pass, as you finish the bottle, and quickly black" PRINT "out." PRINT "" PRINT "End of Chapter 3." PRINT DO: LOOP UNTIL INKEY$ <> "" END lose: COLOR 7, 0 CLS PRINT "You open the bottle and as the lights turn off, you are greeted by" PRINT "the same old man. He shakes his head as the floor gives out. Pity..." DO: LOOP UNTIL INKEY$ <> "" END FUNCTION GrabInput$ x = POS(0) y = CSRLIN maxwidth = _WIDTH - x PCOPY 0, 1 'make a backup copy of the screen DO k = _KEYHIT i$ = INKEY$ LOOP UNTIL k = 0 AND INKEY$ = "" 'clear the keyboard buffer DO _LIMIT 30 PCOPY 1, 0 LOCATE y, x: PRINT Userinput$ k = _KEYHIT SELECT CASE k CASE 8 Userinput$ = LEFT$(Userinput$, LEN(Userinput$) - 1) CASE 65 TO 90, 97 TO 122, 32 Userinput$ = UCASE$(Userinput$ + CHR$(k)) END SELECT timerleft## = (DOOM - TIMER(0.001)) minutes = timerleft## \ 60 seconds = timerleft## - minutes * 60 LOCATE 2, 32: PRINT USING " ###:##.###"; minutes, seconds IF timerleft## <= 0 THEN GOTO doomed _DISPLAY LOOP UNTIL k = 13 GrabInput$ = Userinput$ _AUTODISPLAY EXIT FUNCTION doomed: CLS PRINT "You took to long...everything is lost. Though, they do" PRINT "find your body months later in the woods. Nothing was" PRINT "left but the bones." _DISPLAY END END SUB